<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<style type="text/css">
#ty{
  margin-left: 40%;
}
#bty{
  margin-left: 10%;
}
#ysp{
margin-left: 85%;
}
</style>
<script type="text/javascript">
$(document).ready(function(){
  var v=$("#status").text();
  if(v=="同意"||v=="拒绝"){
  $("#button2").empty();
   $("#button2").append("<button type='button' disabled='disabled'id='ysp'>已审批</button>");
  }
});
 function aa(){
  var m=$("#message").val();
 if(m=="false"){
    $("#status").text("未审批");
    $("#btn1").attr("disabled","false");
   $("#btn2").attr("disabled","false");
 }else{
  var v=$("#status").text();
   if(v=="同意"||v=="拒绝"){
   $("#btn1").attr("disabled","false");
   $("#btn2").attr("disabled","false");
  }else{
   $("#status").text("同意");
   $("#name").text($("#approver").val());
   $("#s").val("1");
      $("#btn1").attr("disabled","false");
   $("#btn2").attr("disabled","false");
}
}
 }
 function bb(){
 var m=$("#message").val();
 if(m=="false"){
   $("#status").text("未审批");
    $("#btn1").attr("disabled","false");
   $("#btn2").attr("disabled","false");
 }else{
  var v=$("#status").text();
   if(v=="同意"||v=="拒绝"){
   $("#btn1").attr("disabled","false");
   $("#btn2").attr("disabled","false");
  }else{
 $("#status").text("拒绝");
 $("#name").text($("#approver").val());
  $("#s").val("2");
     $("#btn1").attr("disabled","false");
   $("#btn2").attr("disabled","false");
}}

 }
</script>
<div class="pageContent">
<form  onsubmit="return validateCallback(this,navTabAjaxDone)" action="breakage/updatestatus.do" method="post">
<div class="pageFormContent" layoutH="56" id="dd4">
<input type="hidden" value="${requestScope.list.id}" id="in" name="id"/>
<input type="hidden" name="status" id="s"/>
<input type="hidden" name="approver" value="${sessionScope.uname }" id="approver"/>
<input type="hidden" name="operator" value="${requestScope.list.operator }"/>
<input type="hidden" name="message" value="${requestScope.ll }" id="message"/>
  <table class="table" width="96%">
     <tr><td>流水号：</td><td>${requestScope.list.code }</td>
     <td>状 态：</td>   
     <c:if test="${requestScope.list.status =='0'}"><td id="status">未审批</td></c:if>
     <c:if test="${requestScope.list.status =='1'}"><td id="status">同意</td></c:if>
     <c:if test="${requestScope.list.status =='2'}"><td id="status">拒绝</td></c:if>
     </tr>
     <tr><td>报损人员：</td><td>${requestScope.list.operator }</td><td>审批人：</td><td id="name">${requestScope.list.approver }</td></tr>
     <tr><td>报损时间：</td><td>${requestScope.list.create_time }</td><td>报损描述：</td><td>${requestScope.list.injury_desc }</td></tr>
     <tr><td>总金额：</td><td>${requestScope.list.money }</td></tr>
  </table>
  <p></p>
  <table class="table" width="96%" >
  <thead>
			<tr>                
			    <th width="100">产品编码</th>
				<th width="100">库房</th>
				<th width="120" >库存数量</th>
				<th width="120">报损数量</th>
				<th width="100">金额</th>
			</tr>
		</thead>
		<tbody>
		<tr>
		<td>${requestScope.list1.goods_id }</td>
		<td>${requestScope.list1.deptname }</td>
		<td>${requestScope.list1.nowsum }</td>
		<td>${requestScope.list1.num }</td>
		<td>${requestScope.list1.money }</td>
		</tr>
		</tbody>
  </table>
  </div>
  		<div class="formBar" id="button2">
  		
					<div class="button" id="ty" ><div class="buttonContent"><button type="submit" id="btn1" onclick="aa()" >同 &nbsp;&nbsp;意</button></div></div>
		           
					<div class="button" id="bty" ><div class="buttonContent"><button type="submit" id="btn2" onclick="bb()">拒 &nbsp;&nbsp;绝</button></div></div>
		
			<ul>		   
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">返 &nbsp;&nbsp;回</button></div></div>
				</li>
			</ul>
		</div>
		</from>
</div>
